package cn.xyinping.hrm.constans;

/**
 * 错误码封装
 */
public enum ErrorCode {
    // ErrorCode LOGIN_USERNAME_IS_NULL = new ErrorCode("1001","用户名不能为空")
    LOGIN_USERNAME_IS_NULL("1001","用户名不能为空"),
    LOGIN_PASSWORD_IS_NULL("1002","密码不能为空"),
    LOGIN_TENANT_IS_NULL("1003","机构不能为空"),
    LOGIN_PHONE_IS_NULL("1004","手机号不能为空"),
    LOGIN_EMAIL_IS_NULL("1005","邮箱不能为空"),
    SYSTEM_INNER_ERROR("1006","系统繁忙");
    // 错误码
    private String code;
    // 错误信息
    private String message;

    ErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }
    // 获取完整错误信息
    public String getFullMessage(){
        return this.getMessage()+"["+this.getCode()+"]";
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
